package com.well.rpc.event;

import com.well.rpc.model.EventType;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 主要存放各种事件
 */
public class EventContext {

    private static ConcurrentHashMap<EventType, AppEvent> events = new ConcurrentHashMap<>();

    public static ConcurrentHashMap<EventType, AppEvent> getEvents() {
        return events;
    }

    public static void setEvent(EventType type, AppEvent event) {
        events.put(type, event);
    }

    public static AppEvent getEventByType(EventType type) {
        return events.get(type);
    }
}
